﻿package mortal.game.view.signUp.view
{
    import com.mui.controls.*;
    import extend.language.*;
    import flash.events.*;
    import flash.text.*;
    import mortal.common.global.*;
    import mortal.game.manager.*;
    import mortal.game.manager.msgTip.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class ActivationTakeView extends SignUpViewBase
    {
        private var _inputBox:GTextInput;
        private var _activeBtn:GLoadingButton;

        public function ActivationTakeView()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.ActivationTakeBg, 0, 1, this));
            this.pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.SerialNumBg, 38, 267, this));
            this._inputBox = UIFactory.gTextInput(250, 329, 349 - 3, 32 - 3, this);
            var _loc_1:* = GlobalStyle.textFormatBai;
            _loc_1.size = 16;
            var _loc_2:* = GlobalStyle.textFormatHui;
            _loc_2.size = 16;
            this._inputBox.setStyle("textFormat", _loc_1);
            this._inputBox.defaultTextTextFormat = _loc_2;
            this._inputBox.defaultText = Language.getString(41377);
            this._inputBox.maxChars = 37;
            this._activeBtn = UIFactory.gLoadingButton(ResFileConst.ActiveBtn, 287, 458, 113, 44, this);
            this._activeBtn.configEventListener(MouseEvent.CLICK, this.onActiveHandler);
            return;
        }// end function

        private function onActiveHandler(event:MouseEvent) : void
        {
            if (this._inputBox.text == "" || this._inputBox.text == this._inputBox.defaultText)
            {
                MsgManager.showMouseMsg(Language.getString(41378), MsgRollTipsType.msgRollTips2);
                return;
            }
            GameProxy.role.activeNewbieCode(this._inputBox.text);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl();
            this._inputBox.dispose();
            this._activeBtn.dispose();
            this._inputBox = null;
            this._activeBtn = null;
            return;
        }// end function

    }
}
